{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# Theme Colors for Geometries\n",
    "\n",
    "In Lets-Plot, default presentation of \"geometry\" employs three \"theme colors\" called **pen**, **brush** and **paper**.\n",
    "\n",
    "* **pen** - a hight-contrast color commonly used to draw dots and lines\n",
    "* **brush** - a color we often use to fill shapes\n",
    "* **paper** - a \"background\" color we often use to fill shapes as well\n",
    "\n",
    "All three colors used by geometries are designed in a way that the shapes are clearly visible regardless a theme \"flavor\" applied.\n",
    "\n",
    "However, on your own risk, you can re-assign any of these colors using the `geom` parameter\\\n",
    "and the `elementGeom()` function in `theme`:\n",
    "\n",
    "```\n",
    "theme(geom = elementGeom(pen = \"red\", brush = \"green\", paper = \"blue\")\n",
    "```"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "   <div id=\"UGBZ0b\"></div>\n",
       "   <script type=\"text/javascript\" data-lets-plot-script=\"library\">\n",
       "       if(!window.letsPlotCallQueue) {\n",
       "           window.letsPlotCallQueue = [];\n",
       "       }; \n",
       "       window.letsPlotCall = function(f) {\n",
       "           window.letsPlotCallQueue.push(f);\n",
       "       };\n",
       "       (function() {\n",
       "           var script = document.createElement(\"script\");\n",
       "           script.type = \"text/javascript\";\n",
       "           script.src = \"https://cdn.jsdelivr.net/gh/JetBrains/lets-plot@v4.0.0/js-package/distr/lets-plot.min.js\";\n",
       "           script.onload = function() {\n",
       "               window.letsPlotCall = function(f) {f();};\n",
       "               window.letsPlotCallQueue.forEach(function(f) {f();});\n",
       "               window.letsPlotCallQueue = [];\n",
       "               \n",
       "               \n",
       "           };\n",
       "           script.onerror = function(event) {\n",
       "               window.letsPlotCall = function(f) {};\n",
       "               window.letsPlotCallQueue = [];\n",
       "               var div = document.createElement(\"div\");\n",
       "               div.style.color = 'darkred';\n",
       "               div.textContent = 'Error loading Lets-Plot JS';\n",
       "               document.getElementById(\"UGBZ0b\").appendChild(div);\n",
       "           };\n",
       "           var e = document.getElementById(\"UGBZ0b\");\n",
       "           e.appendChild(script);\n",
       "       })();\n",
       "   </script>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "text/html": [
       "            <div id=\"kotlin_out_0\"/>\n",
       "            <script type=\"text/javascript\">\n",
       "                            if(!window.kotlinQueues) {\n",
       "                window.kotlinQueues = {};\n",
       "            }\n",
       "            if(!window.kotlinQueues[\"DataFrame\"]) {\n",
       "                var resQueue = [];\n",
       "                window.kotlinQueues[\"DataFrame\"] = resQueue;\n",
       "                window[\"call_DataFrame\"] = function(f) {\n",
       "                    resQueue.push(f);\n",
       "                }\n",
       "            }\n",
       "            (function (){\n",
       "                var modifiers = [(function(script) {\n",
       "    script.src = \"https://cdn.jsdelivr.net/gh/Kotlin/dataframe@3db46ccccaa1291c0627307d64133317f545e6ae/core/src/main/resources/init.js\"\n",
       "    script.type = \"text/javascript\";\n",
       "})];\n",
       "                var e = document.getElementById(\"kotlin_out_0\");\n",
       "                modifiers.forEach(function (gen) {\n",
       "                    var script = document.createElement(\"script\");\n",
       "                    gen(script)\n",
       "                    script.addEventListener(\"load\", function() {\n",
       "                        window[\"call_DataFrame\"] = function(f) {f();};\n",
       "                        window.kotlinQueues[\"DataFrame\"].forEach(function(f) {f();});\n",
       "                        window.kotlinQueues[\"DataFrame\"] = [];\n",
       "                    }, false);\n",
       "                    script.addEventListener(\"error\", function() {\n",
       "                        window[\"call_DataFrame\"] = function(f) {};\n",
       "                        window.kotlinQueues[\"DataFrame\"] = [];\n",
       "                        var div = document.createElement(\"div\");\n",
       "                        div.style.color = 'darkred';\n",
       "                        div.textContent = 'Error loading resource DataFrame';\n",
       "                        document.getElementById(\"kotlin_out_0\").appendChild(div);\n",
       "                    }, false);\n",
       "                    \n",
       "                    e.appendChild(script);\n",
       "                });\n",
       "            })();\n",
       "            </script>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "text/html": [
       "                <style>\n",
       "                :root {\n",
       "    --background: #fff;\n",
       "    --background-odd: #f5f5f5;\n",
       "    --background-hover: #d9edfd;\n",
       "    --header-text-color: #474747;\n",
       "    --text-color: #848484;\n",
       "    --text-color-dark: #000;\n",
       "    --text-color-medium: #737373;\n",
       "    --text-color-pale: #b3b3b3;\n",
       "    --inner-border-color: #aaa;\n",
       "    --bold-border-color: #000;\n",
       "    --link-color: #296eaa;\n",
       "    --link-color-pale: #296eaa;\n",
       "    --link-hover: #1a466c;\n",
       "}\n",
       "\n",
       ":root[theme=\"dark\"], :root [data-jp-theme-light=\"false\"], .dataframe_dark{\n",
       "    --background: #303030;\n",
       "    --background-odd: #3c3c3c;\n",
       "    --background-hover: #464646;\n",
       "    --header-text-color: #dddddd;\n",
       "    --text-color: #b3b3b3;\n",
       "    --text-color-dark: #dddddd;\n",
       "    --text-color-medium: #b2b2b2;\n",
       "    --text-color-pale: #737373;\n",
       "    --inner-border-color: #707070;\n",
       "    --bold-border-color: #777777;\n",
       "    --link-color: #008dc0;\n",
       "    --link-color-pale: #97e1fb;\n",
       "    --link-hover: #00688e;\n",
       "}\n",
       "\n",
       "p.dataframe_description {\n",
       "    color: var(--text-color-dark);\n",
       "}\n",
       "\n",
       "table.dataframe {\n",
       "    font-family: \"Helvetica Neue\", Helvetica, Arial, sans-serif;\n",
       "    font-size: 12px;\n",
       "    background-color: var(--background);\n",
       "    color: var(--text-color-dark);\n",
       "    border: none;\n",
       "    border-collapse: collapse;\n",
       "}\n",
       "\n",
       "table.dataframe th, td {\n",
       "    padding: 6px;\n",
       "    border: 1px solid transparent;\n",
       "    text-align: left;\n",
       "}\n",
       "\n",
       "table.dataframe th {\n",
       "    background-color: var(--background);\n",
       "    color: var(--header-text-color);\n",
       "}\n",
       "\n",
       "table.dataframe td {\n",
       "    vertical-align: top;\n",
       "}\n",
       "\n",
       "table.dataframe th.bottomBorder {\n",
       "    border-bottom-color: var(--bold-border-color);\n",
       "}\n",
       "\n",
       "table.dataframe tbody > tr:nth-child(odd) {\n",
       "    background: var(--background-odd);\n",
       "}\n",
       "\n",
       "table.dataframe tbody > tr:nth-child(even) {\n",
       "    background: var(--background);\n",
       "}\n",
       "\n",
       "table.dataframe tbody > tr:hover {\n",
       "    background: var(--background-hover);\n",
       "}\n",
       "\n",
       "table.dataframe a {\n",
       "    cursor: pointer;\n",
       "    color: var(--link-color);\n",
       "    text-decoration: none;\n",
       "}\n",
       "\n",
       "table.dataframe tr:hover > td a {\n",
       "    color: var(--link-color-pale);\n",
       "}\n",
       "\n",
       "table.dataframe a:hover {\n",
       "    color: var(--link-hover);\n",
       "    text-decoration: underline;\n",
       "}\n",
       "\n",
       "table.dataframe img {\n",
       "    max-width: fit-content;\n",
       "}\n",
       "\n",
       "table.dataframe th.complex {\n",
       "    background-color: var(--background);\n",
       "    border: 1px solid var(--background);\n",
       "}\n",
       "\n",
       "table.dataframe .leftBorder {\n",
       "    border-left-color: var(--inner-border-color);\n",
       "}\n",
       "\n",
       "table.dataframe .rightBorder {\n",
       "    border-right-color: var(--inner-border-color);\n",
       "}\n",
       "\n",
       "table.dataframe .rightAlign {\n",
       "    text-align: right;\n",
       "}\n",
       "\n",
       "table.dataframe .expanderSvg {\n",
       "    width: 8px;\n",
       "    height: 8px;\n",
       "    margin-right: 3px;\n",
       "}\n",
       "\n",
       "table.dataframe .expander {\n",
       "    display: flex;\n",
       "    align-items: center;\n",
       "}\n",
       "\n",
       "/* formatting */\n",
       "\n",
       "table.dataframe .null {\n",
       "    color: var(--text-color-pale);\n",
       "}\n",
       "\n",
       "table.dataframe .structural {\n",
       "    color: var(--text-color-medium);\n",
       "    font-weight: bold;\n",
       "}\n",
       "\n",
       "table.dataframe .dataFrameCaption {\n",
       "    font-weight: bold;\n",
       "}\n",
       "\n",
       "table.dataframe .numbers {\n",
       "    color: var(--text-color-dark);\n",
       "}\n",
       "\n",
       "table.dataframe td:hover .formatted .structural, .null {\n",
       "    color: var(--text-color-dark);\n",
       "}\n",
       "\n",
       "table.dataframe tr:hover .formatted .structural, .null {\n",
       "    color: var(--text-color-dark);\n",
       "}\n",
       "\n",
       "\n",
       "                </style>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "%useLatestDescriptors\n",
    "%use lets-plot\n",
    "%use dataframe"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "Lets-Plot Kotlin API v.4.4.2. Frontend: Notebook with dynamically loaded JS. Lets-Plot JS v.4.0.0."
      ]
     },
     "execution_count": 2,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "LetsPlot.getInfo()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "metadata": {},
   "outputs": [],
   "source": [
    "LetsPlot.theme = themeGrey()"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "#### 1. Typical Defaults"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "   <div id=\"pXGi8B\"></div>\n",
       "   <script type=\"text/javascript\" data-lets-plot-script=\"plot\">\n",
       "       (function() {\n",
       "           var plotSpec={\n",
       "\"layout\":{\n",
       "\"name\":\"grid\",\n",
       "\"ncol\":3,\n",
       "\"nrow\":1,\n",
       "\"fit\":true,\n",
       "\"align\":false\n",
       "},\n",
       "\"figures\":[{\n",
       "\"ggtitle\":{\n",
       "\"text\":\"color: 'pen'\"\n",
       "},\n",
       "\"mapping\":{\n",
       "\"x\":\"x\",\n",
       "\"y\":\"y\"\n",
       "},\n",
       "\"data\":{\n",
       "\"x\":[-12.566370614359172,-12.312504541341815,-12.058638468324459,-11.8047723953071,-11.550906322289745,-11.297040249272387,-11.04317417625503,-10.789308103237673,-10.535442030220317,-10.281575957202959,-10.027709884185603,-9.773843811168245,-9.519977738150889,-9.266111665133531,-9.012245592116175,-8.758379519098817,-8.50451344608146,-8.250647373064103,-7.996781300046746,-7.742915227029389,-7.489049154012032,-7.235183080994675,-6.981317007977318,-6.727450934959961,-6.473584861942604,-6.219718788925246,-5.965852715907889,-5.711986642890533,-5.458120569873176,-5.204254496855819,-4.9503884238384614,-4.6965223508211045,-4.4426562778037475,-4.188790204786391,-3.9349241317690336,-3.6810580587516775,-3.4271919857343196,-3.1733259127169617,-2.9194598396996057,-2.6655937666822496,-2.4117276936648917,-2.157861620647534,-1.9039955476301778,-1.65012947461282,-1.3962634015954638,-1.1423973285781077,-0.8885312555607499,-0.634665182543392,-0.3807991095260359,-0.12693303650867804,0.12693303650867982,0.3807991095260359,0.6346651825433938,0.8885312555607499,1.142397328578106,1.3962634015954638,1.65012947461282,1.9039955476301795,2.157861620647534,2.41172769366489,2.6655937666822496,2.9194598396996057,3.1733259127169635,3.4271919857343196,3.6810580587516775,3.9349241317690336,4.18879020478639,4.442656277803749,4.696522350821105,4.9503884238384614,5.2042544968558175,5.458120569873174,5.711986642890533,5.965852715907889,6.219718788925249,6.473584861942605,6.727450934959961,6.981317007977317,7.235183080994673,7.489049154012033,7.742915227029389,7.996781300046749,8.250647373064105,8.50451344608146,8.758379519098817,9.012245592116173,9.266111665133533,9.519977738150889,9.773843811168245,10.027709884185601,10.281575957202957,10.535442030220317,10.789308103237673,11.043174176255032,11.297040249272388,11.550906322289745,11.8047723953071,12.058638468324457,12.312504541341816,12.566370614359172],\n",
       "\"y\":[4.898587196589413E-16,0.2511479871810805,0.48619673610046904,0.6900790114821128,0.8497254299495145,0.9549022414440742,0.998867339183008,0.9788024462147785,0.8959937742913359,0.7557495743542577,0.5670598638627707,0.342020143325668,0.09505604330418282,-0.15800139597335056,-0.40093053540661344,-0.6181589862206056,-0.7957618405308319,-0.9223542941045816,-0.9898214418809328,-0.9938384644612541,-0.9341478602651067,-0.8145759520503356,-0.6427876096865391,-0.4297949120891715,-0.18925124436041013,0.06342391965656541,0.3120334456984879,0.5406408174555974,0.7345917086575332,0.881453363447582,0.9718115683235419,0.9998741276738751,0.9638421585599419,0.8660254037844388,0.7126941713788626,0.5136773915734069,0.2817325568414294,0.031727933498066525,-0.2203105327865408,-0.45822652172740974,-0.6667690005162917,-0.8325698546347718,-0.9450008187146685,-0.9968547759519424,-0.9848077530122081,-0.9096319953545188,-0.7761464642917569,-0.59290792905464,-0.37166245566032785,-0.1265924535737488,0.12659245357375057,0.37166245566032785,0.5929079290546414,0.7761464642917569,0.9096319953545181,0.9848077530122081,0.9968547759519424,0.9450008187146679,0.8325698546347718,0.666769000516293,0.45822652172740974,0.2203105327865408,-0.0317279334980683,-0.2817325568414294,-0.5136773915734069,-0.7126941713788626,-0.8660254037844379,-0.9638421585599424,-0.9998741276738751,-0.9718115683235419,-0.8814533634475827,-0.734591708657535,-0.5406408174555974,-0.3120334456984879,-0.06342391965656274,0.18925124436041102,0.4297949120891715,0.6427876096865385,0.8145759520503345,0.934147860265107,0.9938384644612541,0.9898214418809325,0.9223542941045809,0.7957618405308319,0.6181589862206056,0.40093053540661505,0.1580013959733488,-0.09505604330418282,-0.342020143325668,-0.5670598638627693,-0.7557495743542565,-0.8959937742913359,-0.9788024462147785,-0.9988673391830079,-0.9549022414440737,-0.8497254299495145,-0.6900790114821128,-0.4861967361004706,-0.2511479871810788,-4.898587196589413E-16]\n",
       "},\n",
       "\"kind\":\"plot\",\n",
       "\"scales\":[],\n",
       "\"layers\":[{\n",
       "\"mapping\":{\n",
       "},\n",
       "\"stat\":\"identity\",\n",
       "\"position\":\"identity\",\n",
       "\"geom\":\"line\",\n",
       "\"data\":{\n",
       "}\n",
       "}],\n",
       "\"theme\":{\n",
       "\"name\":\"grey\"\n",
       "}\n",
       "},{\n",
       "\"ggtitle\":{\n",
       "\"text\":\"fill: 'brush'\"\n",
       "},\n",
       "\"mapping\":{\n",
       "\"x\":\"x\"\n",
       "},\n",
       "\"data\":{\n",
       "},\n",
       "\"kind\":\"plot\",\n",
       "\"scales\":[],\n",
       "\"layers\":[{\n",
       "\"mapping\":{\n",
       "},\n",
       "\"stat\":\"count\",\n",
       "\"position\":\"stack\",\n",
       "\"geom\":\"bar\",\n",
       "\"data\":{\n",
       "\"..count..\":[10.0,9.0,9.0,17.0,13.0,8.0,10.0,5.0,11.0,8.0],\n",
       "\"x\":[7.0,1.0,9.0,4.0,5.0,6.0,0.0,3.0,2.0,8.0]\n",
       "}\n",
       "}],\n",
       "\"theme\":{\n",
       "\"name\":\"grey\"\n",
       "}\n",
       "},{\n",
       "\"ggtitle\":{\n",
       "\"text\":\"fill: 'paper'\"\n",
       "},\n",
       "\"mapping\":{\n",
       "\"x\":\"x\",\n",
       "\"y\":\"y\"\n",
       "},\n",
       "\"data\":{\n",
       "},\n",
       "\"kind\":\"plot\",\n",
       "\"scales\":[],\n",
       "\"layers\":[{\n",
       "\"mapping\":{\n",
       "},\n",
       "\"stat\":\"boxplot\",\n",
       "\"position\":\"dodge\",\n",
       "\"geom\":\"boxplot\",\n",
       "\"data\":{\n",
       "\"..middle..\":[0.024253566305445423,-0.1198583396993898,0.011776491608441707],\n",
       "\"..upper..\":[0.8011407782875886,0.3466155660596803,0.5067047440277812],\n",
       "\"..ymax..\":[1.728335393538597,1.149888392450269,1.3642893761326507],\n",
       "\"x\":[\"C\",\"B\",\"A\"],\n",
       "\"..lower..\":[-0.77814851261271,-0.5348548027951651,-0.19484330411100542],\n",
       "\"..ymin..\":[-1.8238847402568799,-1.665563795397313,-0.9493967166409815]\n",
       "}\n",
       "},{\n",
       "\"mapping\":{\n",
       "},\n",
       "\"stat\":\"boxplot_outlier\",\n",
       "\"show_legend\":false,\n",
       "\"position\":\"dodge\",\n",
       "\"geom\":\"point\",\n",
       "\"data\":{\n",
       "\"..middle..\":[0.024253566305445423,-0.1198583396993898,-0.1198583396993898,-0.1198583396993898,0.011776491608441707,0.011776491608441707,0.011776491608441707],\n",
       "\"..upper..\":[0.8011407782875886,0.3466155660596803,0.3466155660596803,0.3466155660596803,0.5067047440277812,0.5067047440277812,0.5067047440277812],\n",
       "\"..ymax..\":[1.728335393538597,1.149888392450269,1.149888392450269,1.149888392450269,1.3642893761326507,1.3642893761326507,1.3642893761326507],\n",
       "\"x\":[\"C\",\"B\",\"B\",\"B\",\"A\",\"A\",\"A\"],\n",
       "\"..lower..\":[-0.77814851261271,-0.5348548027951651,-0.5348548027951651,-0.5348548027951651,-0.19484330411100542,-0.19484330411100542,-0.19484330411100542],\n",
       "\"y\":[3.21123322772717,1.761590121908906,-1.9912528011945472,-2.024334200561066,1.981607728277233,-1.3049421665543925,2.007788492284059],\n",
       "\"..ymin..\":[-1.8238847402568799,-1.665563795397313,-1.665563795397313,-1.665563795397313,-0.9493967166409815,-0.9493967166409815,-0.9493967166409815]\n",
       "}\n",
       "}],\n",
       "\"theme\":{\n",
       "\"name\":\"grey\"\n",
       "}\n",
       "}],\n",
       "\"kind\":\"subplots\"\n",
       "};\n",
       "           var plotContainer = document.getElementById(\"pXGi8B\");\n",
       "           window.letsPlotCall(function() {{\n",
       "               LetsPlot.buildPlotFromProcessedSpecs(plotSpec, -1, -1, plotContainer);\n",
       "           }});\n",
       "       })();    \n",
       "   </script>"
      ]
     },
     "execution_count": 4,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "val rand = java.util.Random()\n",
    "\n",
    "val n = 100\n",
    "\n",
    "val x = List(n) { index ->\n",
    "    val t = index.toDouble() / (n - 1).toDouble()\n",
    "    -4 * PI + t * 8 * PI\n",
    "}\n",
    "val lineData = mapOf(\"x\" to x, \"y\" to x.map(::sin))\n",
    "val linePlot = letsPlot(lineData) { x = \"x\"; y = \"y\" } + geomLine() + ggtitle(\"color: 'pen'\")\n",
    "\n",
    "val barData = mapOf(\"x\" to List(n) { rand.nextInt(10) })\n",
    "val barPlot = letsPlot(barData) { x = \"x\" } + geomBar() + ggtitle(\"fill: 'brush'\")\n",
    "            \n",
    "val categories = listOf(\"A\", \"B\", \"C\")\n",
    "val boxData = mapOf(\n",
    "    \"x\" to List(n) { categories[abs(rand.nextInt()).rem(categories.size)] },\n",
    "    \"y\" to List(n) { rand.nextGaussian() }\n",
    ")\n",
    "val boxPlot = letsPlot(boxData) { x = \"x\"; y = \"y\" } + geomBoxplot() + ggtitle(\"fill: 'paper'\")\n",
    "\n",
    "gggrid(listOf(linePlot, barPlot, boxPlot))"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "#### 2. Apply Theme Colors Manually\n",
    "\n",
    "Feel free to use \"pen\", \"brush\" or \"paper\" literals to customize individual geometries."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "   <div id=\"EQoVIh\"></div>\n",
       "   <script type=\"text/javascript\" data-lets-plot-script=\"plot\">\n",
       "       (function() {\n",
       "           var plotSpec={\n",
       "\"layout\":{\n",
       "\"name\":\"grid\",\n",
       "\"ncol\":2,\n",
       "\"nrow\":1,\n",
       "\"fit\":true,\n",
       "\"align\":false\n",
       "},\n",
       "\"figures\":[{\n",
       "\"mapping\":{\n",
       "\"x\":\"x\"\n",
       "},\n",
       "\"data\":{\n",
       "},\n",
       "\"kind\":\"plot\",\n",
       "\"scales\":[],\n",
       "\"layers\":[{\n",
       "\"mapping\":{\n",
       "},\n",
       "\"stat\":\"count\",\n",
       "\"color\":\"pen\",\n",
       "\"position\":\"stack\",\n",
       "\"geom\":\"bar\",\n",
       "\"fill\":\"paper\",\n",
       "\"data\":{\n",
       "\"..count..\":[10.0,9.0,9.0,17.0,13.0,8.0,10.0,5.0,11.0,8.0],\n",
       "\"x\":[7.0,1.0,9.0,4.0,5.0,6.0,0.0,3.0,2.0,8.0]\n",
       "}\n",
       "}],\n",
       "\"theme\":{\n",
       "\"name\":\"grey\",\n",
       "\"axis_title_x\":\"blank\"\n",
       "}\n",
       "},{\n",
       "\"mapping\":{\n",
       "\"x\":\"x\"\n",
       "},\n",
       "\"data\":{\n",
       "},\n",
       "\"kind\":\"plot\",\n",
       "\"scales\":[],\n",
       "\"layers\":[{\n",
       "\"mapping\":{\n",
       "},\n",
       "\"stat\":\"count\",\n",
       "\"color\":\"pen\",\n",
       "\"position\":\"stack\",\n",
       "\"geom\":\"bar\",\n",
       "\"fill\":\"paper\",\n",
       "\"data\":{\n",
       "\"..count..\":[10.0,9.0,9.0,17.0,13.0,8.0,10.0,5.0,11.0,8.0],\n",
       "\"x\":[7.0,1.0,9.0,4.0,5.0,6.0,0.0,3.0,2.0,8.0]\n",
       "}\n",
       "}],\n",
       "\"theme\":{\n",
       "\"name\":\"grey\",\n",
       "\"axis_title_x\":\"blank\",\n",
       "\"flavor\":\"solarized_light\"\n",
       "}\n",
       "}],\n",
       "\"ggsize\":{\n",
       "\"width\":800.0,\n",
       "\"height\":200.0\n",
       "},\n",
       "\"kind\":\"subplots\"\n",
       "};\n",
       "           var plotContainer = document.getElementById(\"EQoVIh\");\n",
       "           window.letsPlotCall(function() {{\n",
       "               LetsPlot.buildPlotFromProcessedSpecs(plotSpec, -1, -1, plotContainer);\n",
       "           }});\n",
       "       })();    \n",
       "   </script>"
      ]
     },
     "execution_count": 5,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "val customBar = letsPlot(barData) { x = \"x\" } + geomBar(color = \"pen\", fill = \"paper\") + theme(axisTitleX = \"blank\")\n",
    "\n",
    "gggrid(\n",
    "    listOf(\n",
    "        customBar,\n",
    "        customBar + flavorSolarizedLight()\n",
    "    )\n",
    ") + ggsize(800, 200)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "#### 3. *pen*, *brush* and *paper* with Different Theme Flavors"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "metadata": {},
   "outputs": [],
   "source": [
    "val df = mapOf(\n",
    "  \"name\" to listOf(\"pen\", \"brush\", \"paper\"),\n",
    "  \"slice\" to listOf(1, 3, 3)\n",
    ")"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 7,
   "metadata": {},
   "outputs": [],
   "source": [
    "val pieChart = letsPlot(df) +\n",
    "    geomPie(\n",
    "        stat = Stat.identity,\n",
    "        color = \"pen\",\n",
    "        size = 0.5, \n",
    "        sizeUnit = \"x\",\n",
    "        tooltips = tooltipsNone,\n",
    "        labels = layerLabels().line(\"@name\")\n",
    "    ) { fill = \"name\"; slice = \"slice\" } +\n",
    "    scaleFillManual(listOf(\"pen\", \"brush\", \"paper\"))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 8,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "   <div id=\"9c5t1G\"></div>\n",
       "   <script type=\"text/javascript\" data-lets-plot-script=\"plot\">\n",
       "       (function() {\n",
       "           var plotSpec={\n",
       "\"layout\":{\n",
       "\"name\":\"grid\",\n",
       "\"ncol\":2,\n",
       "\"nrow\":3,\n",
       "\"fit\":true,\n",
       "\"align\":false\n",
       "},\n",
       "\"figures\":[{\n",
       "\"ggtitle\":{\n",
       "\"text\":\"Default\"\n",
       "},\n",
       "\"mapping\":{\n",
       "},\n",
       "\"data\":{\n",
       "\"slice\":[1.0,3.0,3.0],\n",
       "\"name\":[\"pen\",\"brush\",\"paper\"]\n",
       "},\n",
       "\"kind\":\"plot\",\n",
       "\"scales\":[{\n",
       "\"aesthetic\":\"fill\",\n",
       "\"values\":[\"pen\",\"brush\",\"paper\"]\n",
       "}],\n",
       "\"layers\":[{\n",
       "\"mapping\":{\n",
       "\"slice\":\"slice\",\n",
       "\"fill\":\"name\"\n",
       "},\n",
       "\"stat\":\"identity\",\n",
       "\"size\":0.5,\n",
       "\"color\":\"pen\",\n",
       "\"position\":\"identity\",\n",
       "\"geom\":\"pie\",\n",
       "\"tooltips\":\"none\",\n",
       "\"size_unit\":\"x\",\n",
       "\"labels\":{\n",
       "\"lines\":[\"@name\"]\n",
       "},\n",
       "\"data\":{\n",
       "}\n",
       "}],\n",
       "\"theme\":{\n",
       "\"name\":\"grey\"\n",
       "}\n",
       "},{\n",
       "\"ggtitle\":{\n",
       "\"text\":\"Darcula\"\n",
       "},\n",
       "\"mapping\":{\n",
       "},\n",
       "\"data\":{\n",
       "\"slice\":[1.0,3.0,3.0],\n",
       "\"name\":[\"pen\",\"brush\",\"paper\"]\n",
       "},\n",
       "\"kind\":\"plot\",\n",
       "\"scales\":[{\n",
       "\"aesthetic\":\"fill\",\n",
       "\"values\":[\"pen\",\"brush\",\"paper\"]\n",
       "}],\n",
       "\"layers\":[{\n",
       "\"mapping\":{\n",
       "\"slice\":\"slice\",\n",
       "\"fill\":\"name\"\n",
       "},\n",
       "\"stat\":\"identity\",\n",
       "\"size\":0.5,\n",
       "\"color\":\"pen\",\n",
       "\"position\":\"identity\",\n",
       "\"geom\":\"pie\",\n",
       "\"tooltips\":\"none\",\n",
       "\"size_unit\":\"x\",\n",
       "\"labels\":{\n",
       "\"lines\":[\"@name\"]\n",
       "},\n",
       "\"data\":{\n",
       "}\n",
       "}],\n",
       "\"theme\":{\n",
       "\"name\":\"grey\",\n",
       "\"flavor\":\"darcula\"\n",
       "}\n",
       "},{\n",
       "\"ggtitle\":{\n",
       "\"text\":\"SolarizedLight\"\n",
       "},\n",
       "\"mapping\":{\n",
       "},\n",
       "\"data\":{\n",
       "\"slice\":[1.0,3.0,3.0],\n",
       "\"name\":[\"pen\",\"brush\",\"paper\"]\n",
       "},\n",
       "\"kind\":\"plot\",\n",
       "\"scales\":[{\n",
       "\"aesthetic\":\"fill\",\n",
       "\"values\":[\"pen\",\"brush\",\"paper\"]\n",
       "}],\n",
       "\"layers\":[{\n",
       "\"mapping\":{\n",
       "\"slice\":\"slice\",\n",
       "\"fill\":\"name\"\n",
       "},\n",
       "\"stat\":\"identity\",\n",
       "\"size\":0.5,\n",
       "\"color\":\"pen\",\n",
       "\"position\":\"identity\",\n",
       "\"geom\":\"pie\",\n",
       "\"tooltips\":\"none\",\n",
       "\"size_unit\":\"x\",\n",
       "\"labels\":{\n",
       "\"lines\":[\"@name\"]\n",
       "},\n",
       "\"data\":{\n",
       "}\n",
       "}],\n",
       "\"theme\":{\n",
       "\"name\":\"grey\",\n",
       "\"flavor\":\"solarized_light\"\n",
       "}\n",
       "},{\n",
       "\"ggtitle\":{\n",
       "\"text\":\"SolarizedDark\"\n",
       "},\n",
       "\"mapping\":{\n",
       "},\n",
       "\"data\":{\n",
       "\"slice\":[1.0,3.0,3.0],\n",
       "\"name\":[\"pen\",\"brush\",\"paper\"]\n",
       "},\n",
       "\"kind\":\"plot\",\n",
       "\"scales\":[{\n",
       "\"aesthetic\":\"fill\",\n",
       "\"values\":[\"pen\",\"brush\",\"paper\"]\n",
       "}],\n",
       "\"layers\":[{\n",
       "\"mapping\":{\n",
       "\"slice\":\"slice\",\n",
       "\"fill\":\"name\"\n",
       "},\n",
       "\"stat\":\"identity\",\n",
       "\"size\":0.5,\n",
       "\"color\":\"pen\",\n",
       "\"position\":\"identity\",\n",
       "\"geom\":\"pie\",\n",
       "\"tooltips\":\"none\",\n",
       "\"size_unit\":\"x\",\n",
       "\"labels\":{\n",
       "\"lines\":[\"@name\"]\n",
       "},\n",
       "\"data\":{\n",
       "}\n",
       "}],\n",
       "\"theme\":{\n",
       "\"name\":\"grey\",\n",
       "\"flavor\":\"solarized_dark\"\n",
       "}\n",
       "},{\n",
       "\"ggtitle\":{\n",
       "\"text\":\"HighContrastLight\"\n",
       "},\n",
       "\"mapping\":{\n",
       "},\n",
       "\"data\":{\n",
       "\"slice\":[1.0,3.0,3.0],\n",
       "\"name\":[\"pen\",\"brush\",\"paper\"]\n",
       "},\n",
       "\"kind\":\"plot\",\n",
       "\"scales\":[{\n",
       "\"aesthetic\":\"fill\",\n",
       "\"values\":[\"pen\",\"brush\",\"paper\"]\n",
       "}],\n",
       "\"layers\":[{\n",
       "\"mapping\":{\n",
       "\"slice\":\"slice\",\n",
       "\"fill\":\"name\"\n",
       "},\n",
       "\"stat\":\"identity\",\n",
       "\"size\":0.5,\n",
       "\"color\":\"pen\",\n",
       "\"position\":\"identity\",\n",
       "\"geom\":\"pie\",\n",
       "\"tooltips\":\"none\",\n",
       "\"size_unit\":\"x\",\n",
       "\"labels\":{\n",
       "\"lines\":[\"@name\"]\n",
       "},\n",
       "\"data\":{\n",
       "}\n",
       "}],\n",
       "\"theme\":{\n",
       "\"name\":\"grey\",\n",
       "\"flavor\":\"high_contrast_light\"\n",
       "}\n",
       "},{\n",
       "\"ggtitle\":{\n",
       "\"text\":\"HighContrastDark\"\n",
       "},\n",
       "\"mapping\":{\n",
       "},\n",
       "\"data\":{\n",
       "\"slice\":[1.0,3.0,3.0],\n",
       "\"name\":[\"pen\",\"brush\",\"paper\"]\n",
       "},\n",
       "\"kind\":\"plot\",\n",
       "\"scales\":[{\n",
       "\"aesthetic\":\"fill\",\n",
       "\"values\":[\"pen\",\"brush\",\"paper\"]\n",
       "}],\n",
       "\"layers\":[{\n",
       "\"mapping\":{\n",
       "\"slice\":\"slice\",\n",
       "\"fill\":\"name\"\n",
       "},\n",
       "\"stat\":\"identity\",\n",
       "\"size\":0.5,\n",
       "\"color\":\"pen\",\n",
       "\"position\":\"identity\",\n",
       "\"geom\":\"pie\",\n",
       "\"tooltips\":\"none\",\n",
       "\"size_unit\":\"x\",\n",
       "\"labels\":{\n",
       "\"lines\":[\"@name\"]\n",
       "},\n",
       "\"data\":{\n",
       "}\n",
       "}],\n",
       "\"theme\":{\n",
       "\"name\":\"grey\",\n",
       "\"flavor\":\"high_contrast_dark\"\n",
       "}\n",
       "}],\n",
       "\"kind\":\"subplots\"\n",
       "};\n",
       "           var plotContainer = document.getElementById(\"9c5t1G\");\n",
       "           window.letsPlotCall(function() {{\n",
       "               LetsPlot.buildPlotFromProcessedSpecs(plotSpec, -1, -1, plotContainer);\n",
       "           }});\n",
       "       })();    \n",
       "   </script>"
      ]
     },
     "execution_count": 8,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "gggrid(\n",
    "    listOf(\n",
    "        pieChart + ggtitle(\"Default\"),\n",
    "        pieChart + flavorDarcula() + ggtitle(\"Darcula\"),\n",
    "        pieChart + flavorSolarizedLight() + ggtitle(\"SolarizedLight\"),\n",
    "        pieChart + flavorSolarizedDark() + ggtitle(\"SolarizedDark\"),\n",
    "        pieChart + flavorHighContrastLight() + ggtitle(\"HighContrastLight\"),\n",
    "        pieChart + flavorHighContrastDark() + ggtitle(\"HighContrastDark\")\n",
    "    ), \n",
    "    ncol = 2\n",
    ")"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "#### 4. Re-assigning Geometry Theme Colors"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 9,
   "metadata": {},
   "outputs": [],
   "source": [
    "val orangeTheme = theme(geom = elementGeom(pen = \"#ff4500\", brush = \"#ff7f50\", paper = \"#ffcba4\"))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 10,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "   <div id=\"VtBGX4\"></div>\n",
       "   <script type=\"text/javascript\" data-lets-plot-script=\"plot\">\n",
       "       (function() {\n",
       "           var plotSpec={\n",
       "\"mapping\":{\n",
       "},\n",
       "\"data\":{\n",
       "\"slice\":[1.0,3.0,3.0],\n",
       "\"name\":[\"pen\",\"brush\",\"paper\"]\n",
       "},\n",
       "\"kind\":\"plot\",\n",
       "\"scales\":[{\n",
       "\"aesthetic\":\"fill\",\n",
       "\"values\":[\"pen\",\"brush\",\"paper\"]\n",
       "}],\n",
       "\"layers\":[{\n",
       "\"mapping\":{\n",
       "\"slice\":\"slice\",\n",
       "\"fill\":\"name\"\n",
       "},\n",
       "\"stat\":\"identity\",\n",
       "\"size\":0.5,\n",
       "\"color\":\"pen\",\n",
       "\"position\":\"identity\",\n",
       "\"geom\":\"pie\",\n",
       "\"tooltips\":\"none\",\n",
       "\"size_unit\":\"x\",\n",
       "\"labels\":{\n",
       "\"lines\":[\"@name\"]\n",
       "},\n",
       "\"data\":{\n",
       "}\n",
       "}],\n",
       "\"theme\":{\n",
       "\"name\":\"grey\",\n",
       "\"geom\":{\n",
       "\"pen\":\"#ff4500\",\n",
       "\"brush\":\"#ff7f50\",\n",
       "\"paper\":\"#ffcba4\"\n",
       "}\n",
       "}\n",
       "};\n",
       "           var plotContainer = document.getElementById(\"VtBGX4\");\n",
       "           window.letsPlotCall(function() {{\n",
       "               LetsPlot.buildPlotFromProcessedSpecs(plotSpec, -1, -1, plotContainer);\n",
       "           }});\n",
       "       })();    \n",
       "   </script>"
      ]
     },
     "execution_count": 10,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "pieChart + orangeTheme"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 11,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "   <div id=\"gW0CfH\"></div>\n",
       "   <script type=\"text/javascript\" data-lets-plot-script=\"plot\">\n",
       "       (function() {\n",
       "           var plotSpec={\n",
       "\"layout\":{\n",
       "\"name\":\"grid\",\n",
       "\"ncol\":3,\n",
       "\"nrow\":1,\n",
       "\"fit\":true,\n",
       "\"align\":false\n",
       "},\n",
       "\"figures\":[{\n",
       "\"ggtitle\":{\n",
       "\"text\":\"color: 'pen'\"\n",
       "},\n",
       "\"mapping\":{\n",
       "\"x\":\"x\",\n",
       "\"y\":\"y\"\n",
       "},\n",
       "\"data\":{\n",
       "\"x\":[-12.566370614359172,-12.312504541341815,-12.058638468324459,-11.8047723953071,-11.550906322289745,-11.297040249272387,-11.04317417625503,-10.789308103237673,-10.535442030220317,-10.281575957202959,-10.027709884185603,-9.773843811168245,-9.519977738150889,-9.266111665133531,-9.012245592116175,-8.758379519098817,-8.50451344608146,-8.250647373064103,-7.996781300046746,-7.742915227029389,-7.489049154012032,-7.235183080994675,-6.981317007977318,-6.727450934959961,-6.473584861942604,-6.219718788925246,-5.965852715907889,-5.711986642890533,-5.458120569873176,-5.204254496855819,-4.9503884238384614,-4.6965223508211045,-4.4426562778037475,-4.188790204786391,-3.9349241317690336,-3.6810580587516775,-3.4271919857343196,-3.1733259127169617,-2.9194598396996057,-2.6655937666822496,-2.4117276936648917,-2.157861620647534,-1.9039955476301778,-1.65012947461282,-1.3962634015954638,-1.1423973285781077,-0.8885312555607499,-0.634665182543392,-0.3807991095260359,-0.12693303650867804,0.12693303650867982,0.3807991095260359,0.6346651825433938,0.8885312555607499,1.142397328578106,1.3962634015954638,1.65012947461282,1.9039955476301795,2.157861620647534,2.41172769366489,2.6655937666822496,2.9194598396996057,3.1733259127169635,3.4271919857343196,3.6810580587516775,3.9349241317690336,4.18879020478639,4.442656277803749,4.696522350821105,4.9503884238384614,5.2042544968558175,5.458120569873174,5.711986642890533,5.965852715907889,6.219718788925249,6.473584861942605,6.727450934959961,6.981317007977317,7.235183080994673,7.489049154012033,7.742915227029389,7.996781300046749,8.250647373064105,8.50451344608146,8.758379519098817,9.012245592116173,9.266111665133533,9.519977738150889,9.773843811168245,10.027709884185601,10.281575957202957,10.535442030220317,10.789308103237673,11.043174176255032,11.297040249272388,11.550906322289745,11.8047723953071,12.058638468324457,12.312504541341816,12.566370614359172],\n",
       "\"y\":[4.898587196589413E-16,0.2511479871810805,0.48619673610046904,0.6900790114821128,0.8497254299495145,0.9549022414440742,0.998867339183008,0.9788024462147785,0.8959937742913359,0.7557495743542577,0.5670598638627707,0.342020143325668,0.09505604330418282,-0.15800139597335056,-0.40093053540661344,-0.6181589862206056,-0.7957618405308319,-0.9223542941045816,-0.9898214418809328,-0.9938384644612541,-0.9341478602651067,-0.8145759520503356,-0.6427876096865391,-0.4297949120891715,-0.18925124436041013,0.06342391965656541,0.3120334456984879,0.5406408174555974,0.7345917086575332,0.881453363447582,0.9718115683235419,0.9998741276738751,0.9638421585599419,0.8660254037844388,0.7126941713788626,0.5136773915734069,0.2817325568414294,0.031727933498066525,-0.2203105327865408,-0.45822652172740974,-0.6667690005162917,-0.8325698546347718,-0.9450008187146685,-0.9968547759519424,-0.9848077530122081,-0.9096319953545188,-0.7761464642917569,-0.59290792905464,-0.37166245566032785,-0.1265924535737488,0.12659245357375057,0.37166245566032785,0.5929079290546414,0.7761464642917569,0.9096319953545181,0.9848077530122081,0.9968547759519424,0.9450008187146679,0.8325698546347718,0.666769000516293,0.45822652172740974,0.2203105327865408,-0.0317279334980683,-0.2817325568414294,-0.5136773915734069,-0.7126941713788626,-0.8660254037844379,-0.9638421585599424,-0.9998741276738751,-0.9718115683235419,-0.8814533634475827,-0.734591708657535,-0.5406408174555974,-0.3120334456984879,-0.06342391965656274,0.18925124436041102,0.4297949120891715,0.6427876096865385,0.8145759520503345,0.934147860265107,0.9938384644612541,0.9898214418809325,0.9223542941045809,0.7957618405308319,0.6181589862206056,0.40093053540661505,0.1580013959733488,-0.09505604330418282,-0.342020143325668,-0.5670598638627693,-0.7557495743542565,-0.8959937742913359,-0.9788024462147785,-0.9988673391830079,-0.9549022414440737,-0.8497254299495145,-0.6900790114821128,-0.4861967361004706,-0.2511479871810788,-4.898587196589413E-16]\n",
       "},\n",
       "\"kind\":\"plot\",\n",
       "\"scales\":[],\n",
       "\"layers\":[{\n",
       "\"mapping\":{\n",
       "},\n",
       "\"stat\":\"identity\",\n",
       "\"position\":\"identity\",\n",
       "\"geom\":\"line\",\n",
       "\"data\":{\n",
       "}\n",
       "}],\n",
       "\"theme\":{\n",
       "\"name\":\"grey\",\n",
       "\"geom\":{\n",
       "\"pen\":\"#ff4500\",\n",
       "\"brush\":\"#ff7f50\",\n",
       "\"paper\":\"#ffcba4\"\n",
       "}\n",
       "}\n",
       "},{\n",
       "\"ggtitle\":{\n",
       "\"text\":\"fill: 'brush'\"\n",
       "},\n",
       "\"mapping\":{\n",
       "\"x\":\"x\"\n",
       "},\n",
       "\"data\":{\n",
       "},\n",
       "\"kind\":\"plot\",\n",
       "\"scales\":[],\n",
       "\"layers\":[{\n",
       "\"mapping\":{\n",
       "},\n",
       "\"stat\":\"count\",\n",
       "\"position\":\"stack\",\n",
       "\"geom\":\"bar\",\n",
       "\"data\":{\n",
       "\"..count..\":[10.0,9.0,9.0,17.0,13.0,8.0,10.0,5.0,11.0,8.0],\n",
       "\"x\":[7.0,1.0,9.0,4.0,5.0,6.0,0.0,3.0,2.0,8.0]\n",
       "}\n",
       "}],\n",
       "\"theme\":{\n",
       "\"name\":\"grey\",\n",
       "\"geom\":{\n",
       "\"pen\":\"#ff4500\",\n",
       "\"brush\":\"#ff7f50\",\n",
       "\"paper\":\"#ffcba4\"\n",
       "}\n",
       "}\n",
       "},{\n",
       "\"ggtitle\":{\n",
       "\"text\":\"fill: 'paper'\"\n",
       "},\n",
       "\"mapping\":{\n",
       "\"x\":\"x\",\n",
       "\"y\":\"y\"\n",
       "},\n",
       "\"data\":{\n",
       "},\n",
       "\"kind\":\"plot\",\n",
       "\"scales\":[],\n",
       "\"layers\":[{\n",
       "\"mapping\":{\n",
       "},\n",
       "\"stat\":\"boxplot\",\n",
       "\"position\":\"dodge\",\n",
       "\"geom\":\"boxplot\",\n",
       "\"data\":{\n",
       "\"..middle..\":[0.024253566305445423,-0.1198583396993898,0.011776491608441707],\n",
       "\"..upper..\":[0.8011407782875886,0.3466155660596803,0.5067047440277812],\n",
       "\"..ymax..\":[1.728335393538597,1.149888392450269,1.3642893761326507],\n",
       "\"x\":[\"C\",\"B\",\"A\"],\n",
       "\"..lower..\":[-0.77814851261271,-0.5348548027951651,-0.19484330411100542],\n",
       "\"..ymin..\":[-1.8238847402568799,-1.665563795397313,-0.9493967166409815]\n",
       "}\n",
       "},{\n",
       "\"mapping\":{\n",
       "},\n",
       "\"stat\":\"boxplot_outlier\",\n",
       "\"show_legend\":false,\n",
       "\"position\":\"dodge\",\n",
       "\"geom\":\"point\",\n",
       "\"data\":{\n",
       "\"..middle..\":[0.024253566305445423,-0.1198583396993898,-0.1198583396993898,-0.1198583396993898,0.011776491608441707,0.011776491608441707,0.011776491608441707],\n",
       "\"..upper..\":[0.8011407782875886,0.3466155660596803,0.3466155660596803,0.3466155660596803,0.5067047440277812,0.5067047440277812,0.5067047440277812],\n",
       "\"..ymax..\":[1.728335393538597,1.149888392450269,1.149888392450269,1.149888392450269,1.3642893761326507,1.3642893761326507,1.3642893761326507],\n",
       "\"x\":[\"C\",\"B\",\"B\",\"B\",\"A\",\"A\",\"A\"],\n",
       "\"..lower..\":[-0.77814851261271,-0.5348548027951651,-0.5348548027951651,-0.5348548027951651,-0.19484330411100542,-0.19484330411100542,-0.19484330411100542],\n",
       "\"y\":[3.21123322772717,1.761590121908906,-1.9912528011945472,-2.024334200561066,1.981607728277233,-1.3049421665543925,2.007788492284059],\n",
       "\"..ymin..\":[-1.8238847402568799,-1.665563795397313,-1.665563795397313,-1.665563795397313,-0.9493967166409815,-0.9493967166409815,-0.9493967166409815]\n",
       "}\n",
       "}],\n",
       "\"theme\":{\n",
       "\"name\":\"grey\",\n",
       "\"geom\":{\n",
       "\"pen\":\"#ff4500\",\n",
       "\"brush\":\"#ff7f50\",\n",
       "\"paper\":\"#ffcba4\"\n",
       "}\n",
       "}\n",
       "}],\n",
       "\"kind\":\"subplots\"\n",
       "};\n",
       "           var plotContainer = document.getElementById(\"gW0CfH\");\n",
       "           window.letsPlotCall(function() {{\n",
       "               LetsPlot.buildPlotFromProcessedSpecs(plotSpec, -1, -1, plotContainer);\n",
       "           }});\n",
       "       })();    \n",
       "   </script>"
      ]
     },
     "execution_count": 11,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "gggrid(\n",
    "    listOf(\n",
    "        linePlot + orangeTheme,\n",
    "        barPlot + orangeTheme,\n",
    "        boxPlot + orangeTheme\n",
    "    )\n",
    ")"
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Kotlin",
   "language": "kotlin",
   "name": "kotlin"
  },
  "language_info": {
   "codemirror_mode": "text/x-kotlin",
   "file_extension": ".kt",
   "mimetype": "text/x-kotlin",
   "name": "kotlin",
   "nbconvert_exporter": "",
   "pygments_lexer": "kotlin",
   "version": "1.8.20"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 4
}
